import { BaseEntity } from '@libs/common/entities';
import { Column, Entity, Index } from 'typeorm';

enum AtmStatus {
  ACTIVE = 1,
  INACTIVE = 0,
}

@Index('mcuid_axisY_axisX', ['mcuid', 'axisY', 'axisX'], { unique: true })
@Entity('crm_node_atm_device_road')
export class DeviceRoad extends BaseEntity {
  @Column({ comment: '设备名称' })
  name: string;

  @Column({ comment: '机器通讯唯一标识' })
  mcuid: string;

  @Column({ comment: '设备说明' })
  descri?: string;

  @Column({
    type: 'enum',
    enum: AtmStatus,
    comment: '1-启用，0-停用',
    default: AtmStatus['ACTIVE'],
  })
  active?: AtmStatus = AtmStatus['ACTIVE'];

  @Column({ comment: 'X轴' })
  axisX: number;

  @Column({ comment: 'Y轴' })
  axisY: number;

  @Column({ comment: '货道容量' })
  axisZ: number;

  @Column({ comment: '货道号' })
  roadNo: string;
}
